<?php
	$process_type = "add";	// Please choose only ONE !! Edit / Preview / Delete . 'Edit' and 'Add' are considered as the same value.
	$process_module_name = "logo";	// Module Name
	$process_module_id = "5";	// Module ID
	$process_module_sub_id = "0";	// Module Sub ID
	$process_module_category = "management"; // Module Category
	$rowDivWidth = 60;	// Width for first column label form (pixel)
	$rowDivWidth2 = 140;	// Width for first column label form (pixel)
	$form_name = "form_logo";	// Form Name
	$form_action = "proc_logo.php";	// Form Action
?>
<div class="content">
	<form action="process/<?php echo $form_action; ?>" method="post" enctype="multipart/form-data" name="<?php echo $form_name; ?>" id="files" style="margin:0; padding:0;">
	<?php include("action/act_includes_global/1_act_inc_global_formstartconfig.php"); // Do not Edit !!! ?>
	<?php include("action/act_includes_global/3_act_inc_global_formrowdatahidden.php"); // Do not Edit !!! Every form must include this file !  ?>
	
	<div class="content_header_left">
		<!-- Start Content Header Left -->
		<?php include("ws_includes/1_ws_inc_priviligestring.php"); ?>
		<?php include("ws_includes/2_ws_inc_headerlabel.php"); ?>
		<!-- End Content Header Left -->
	</div>
	<div class="content_header_right">
		<!-- Start Content Header Right -->
		
		<!-- End Content Header Right -->
	</div>
	<div style="clear:both;"></div>
	<div class="content_body">
		<!-- Start Content Body -->
		<?php if($privilegeView == 1) { ?>
			<div style="padding:10px; border:solid 1px black;">
				<div style="float:left; padding:10px;">
					<div class="divFormRowData">
						<span class="header_label_string">UPLOAD LOGO / FAVICON</span>
						<br />
						<br />
					</div>
					<div class="divFormRowData">
						<div style="float:left; text-align:right; width:<?php echo $rowDivWidth; ?>px;">File</div>
						<div style="float:left;">&nbsp;:&nbsp;</div>
						<div style="float:left;">
							<input type="file" name="file" id="file" required style="width:400px;" />
						</div>
						<div style="clear:both;"></div>
					</div>
					<div class="divFormRowData">
						<div style="float:left; text-align:right; width:<?php echo $rowDivWidth; ?>px;">Label</div>
						<div style="float:left;">&nbsp;:&nbsp;</div>
						<div style="float:left;">
							<input <?php if($process_type == "PREVIEW" || $process_type == "DELETE"){echo "disabled='disabled'";} ?> type="text" required name="txt_logo_label" style="width:300px; height:18px;" />
						</div>
						<div style="clear:both;"></div>
					</div>
					<div class="divFormRowData">
						<div style="float:left; text-align:right; width:<?php echo $rowDivWidth; ?>px;">Role</div>
						<div style="float:left;">&nbsp;:&nbsp;</div>
						<div style="float:left;">
							<input <?php if($process_type == "PREVIEW" || $process_type == "DELETE"){echo "disabled='disabled'";} ?> type="radio" name="rdo_logo_role" value="logo" checked="checked" /> Logo
							<input <?php if($process_type == "PREVIEW" || $process_type == "DELETE"){echo "disabled='disabled'";} ?> type="radio" name="rdo_logo_role" value="favicon" /> FavIcon
						</div>
						<div style="clear:both;"></div>
					</div>
					<div class="divFormRowData">
						<div style="float:left;">
							<input type="submit" name="submit" value="Upload" />
						</div>
						<div style="clear:both;"></div>
					</div>
				</div>
				<div style="float:right; padding:10px; border:solid 1px black;">
					<div class="divFormRowData">
						<span class="header_label_string">IMAGE RULES</span>
						<br />
						<br />
					</div>
					<div class="divFormRowData">
						<div style="float:left; text-align:right; width:<?php echo $rowDivWidth2; ?>px;">Max File Size allowed</div>
						<div style="float:left;">&nbsp;:&nbsp;</div>
						<div style="float:left;"><?php echo format_size(logo_size_allowed()); ?></div>
						<div style="clear:both;"></div>
					</div>
					<div class="divFormRowData">
						<div style="float:left; text-align:right; width:<?php echo $rowDivWidth2; ?>px;">File Extension allowed</div>
						<div style="float:left;">&nbsp;:&nbsp;</div>
						<div style="float:left;"><?php echo implode("<br />",logo_extension_allowed()); ?></div>
						<div style="clear:both;"></div>
					</div>
					<div class="divFormRowData">
						<div style="float:left; text-align:right; width:<?php echo $rowDivWidth2; ?>px;">File Type allowed</div>
						<div style="float:left;">&nbsp;:&nbsp;</div>
						<div style="float:left;"><?php echo implode("<br />",logo_type_allowed()); ?></div>
						<div style="clear:both;"></div>
					</div>
				</div>
				
				<div style="clear:both;"></div>
			</div>
			<div>
				<div style="float:left; padding:10px; border:solid 1px black; margin-top:10px; overflow: auto; height:190px;">
					<div class="divFormRowData">
						<div style="float:left;">
							<span class="header_label_string">LOGO</span>
							<br />
							<br />
						</div>
						<div style="float:right;">
							<?php
								$sql = "select * from ms_file where stsrc = 'A' and filerole = 'logo' order by dateup desc, datein desc limit 0,1";
								$exe = mysql_query($sql) or die(mysql_error());
								$num = mysql_num_rows($exe);
								$row = mysql_fetch_array($exe);
								
								if($num > 0)
								{
							?>
									<div style="float:left; padding-left:5px;">
										<a title="Preview" href="action/act_logo_preview.php#<?php echo $row['fileid']; ?>" class="nyroModal">
											<img src="<?php echo getURLdomain(); ?>/source/global/img/preview-icon.png" width="24" />
										</a>
									</div>
									<div style="float:left; padding-left:5px;">
										<a title="Edit" href="action/act_logo_addedit.php#<?php echo $row['fileid']; ?>" class="nyroModal">
											<img src="<?php echo getURLdomain(); ?>/source/global/img/edit-icon.png" width="24" />
										</a>
									</div>
									<div style="float:left; padding-left:5px;">
										<a title="Delete" href="action/act_logo_delete.php#<?php echo $row['fileid']; ?>" class="nyroModal">
											<img src="<?php echo getURLdomain(); ?>/source/global/img/delete-icon.png" width="24" />
										</a>
									</div>
									<div style="clear:both;"></div>
							<?php
								}
							?>
						</div>
						<div style="clear:both;"></div>
					</div>
					<div class="divFormRowData">
						<?php
							$sql = "select * from ms_file where stsrc = 'A' and filerole = 'logo' order by dateup desc, datein desc limit 0,1";
							$exe = mysql_query($sql) or die(mysql_error());
							$num = mysql_num_rows($exe);
							$row = mysql_fetch_array($exe);
							
							if($num > 0)
							{
						?>
								<img src="<?php echo getURLdomain()."/upload/".$row['filename']; ?>" />
						<?php
							}
							else
							{
						?>
								<img src="<?php echo PATH_LOGO; ?>" style="max-height:140px;" />
						<?php
							}
						?>
					</div>
				</div>
				<div style="float:left; padding:10px; border:solid 1px black; margin-top:10px; margin-left:10px; overflow: auto;">
					<div class="divFormRowData">
						<div style="float:left;">
							<span class="header_label_string">FAVICON</span>
							<br />
							<br />
						</div>
						<div style="float:right;">
							<?php
								$sql = "select * from ms_file where stsrc = 'A' and filerole = 'favicon' order by dateup desc, datein desc limit 0,1";
								$exe = mysql_query($sql) or die(mysql_error());
								$num = mysql_num_rows($exe);
								$row = mysql_fetch_array($exe);
								
								if($num > 0)
								{
							?>
									<div style="float:left; padding-left:5px;">
										<a title="Preview" href="action/act_logo_preview.php#<?php echo $row['fileid']; ?>" class="nyroModal">
											<img src="<?php echo getURLdomain(); ?>/source/global/img/preview-icon.png" width="24" />
										</a>
									</div>
									<div style="float:left; padding-left:5px;">
										<a title="Edit" href="action/act_logo_addedit.php#<?php echo $row['fileid']; ?>" class="nyroModal">
											<img src="<?php echo getURLdomain(); ?>/source/global/img/edit-icon.png" width="24" />
										</a>
									</div>
									<div style="float:left; padding-left:5px;">
										<a title="Delete" href="action/act_logo_delete.php#<?php echo $row['fileid']; ?>" class="nyroModal">
											<img src="<?php echo getURLdomain(); ?>/source/global/img/delete-icon.png" width="24" />
										</a>
									</div>
									<div style="clear:both;"></div>
							<?php
								}
							?>
						</div>
						<div style="clear:both;"></div>
					</div>
					<div class="divFormRowData">
						<?php
							$sql = "select * from ms_file where stsrc = 'A' and filerole = 'favicon' order by dateup desc, datein desc limit 0,1";
							$exe = mysql_query($sql) or die(mysql_error());
							$num = mysql_num_rows($exe);
							$row = mysql_fetch_array($exe);
							
							if($num > 0)
							{
						?>
								<img src="<?php echo getURLdomain()."/upload/".$row['filename']; ?>" style="max-width:16px; max-height:16px;" />
						<?php
							}
							else
							{
						?>
								<img src="<?php echo PATH_FAVICON; ?>" style="max-height:140px;" />
						<?php
							}
						?>
					</div>
				</div>
				<div style="clear:both;"></div>
			</div>
		<?php } ?>
		<!-- End Content Body -->
	</div>
	<div style="clear:both;"></div>
	</form>
</div>